home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-08-23 | 25.2 KB | 1,020 lines |
- Newsgroups: comp.sources.misc
- From: Raymond Chen <rjc@math.princeton.edu>
- Subject: v22i056: wp2x - WordPerfect4.2 to Whatever converter, Part02/03
- Message-ID: <1991Aug23.184910.9743@sparky.IMD.Sterling.COM>
- X-Md4-Signature: 5129a12ab779c46f97628736316fe07a
- Date: Fri, 23 Aug 1991 18:49:10 GMT
- Approved: kent@sparky.imd.sterling.com
-
- Submitted-by: Raymond Chen <rjc@math.princeton.edu>
- Posting-number: Volume 22, Issue 56
- Archive-name: wp2x/part02
- Environment: Amiga, MS-DOS, UNIX, ANSI-C
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then unpack
- # it by saving it into a file and typing "sh file". To overwrite existing
- # files, type "sh file -c". You can also feed this as standard input via
- # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
- # will see the following message at the end:
- # "End of archive 2 (of 3)."
- # Contents: tex.cfg wp2x.1l
- # Wrapped by rjc@tomato on Wed Aug 21 00:08:05 1991
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'tex.cfg' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'tex.cfg'\"
- else
- echo shar: Extracting \"'tex.cfg'\" \(6395 characters\)
- sed "s/^X//" >'tex.cfg' <<'END_OF_FILE'
- X# TeX configuration file for WP2X.
- X#
- X# Written 5/20/89 by Raymond Chen.
- X# Updated 7/05/91 by Raymond Chen.
- X#
- X# If you change this file, please make a note of it below
- X# and in the BEGIN string. (And probably also in the typeout
- X# string.)
- X#
- X# Version 0.0: Initial version.
- X# Version 0.1: Add more magic characters.
- X# Version 0.2: Add new tags, reorder existing tags for easier comparison.
- X# Version 0.3: Fix Note#
- X# Version 0.4: Fix some %'s that weren't doubled
- X# Version 0.5: Discuss { } \
- X# Version 0.6: New output scheme.
- X
- Xtypeout="TeX descriptor file for WP2X by Raymond Chen\n"
- X
- X# At the beginning of the file, we put some macros which are
- X# used by the page numbering routines.
- X
- XBEGIN="%% This file was created by the WP2X program, using a TeX
- X%% descriptor file (Version 0.6) written by Raymond Chen.
- X%% Do not expect everything to be converted perfectly.
- X%%
- X%% Macros for page numbering.
- X\\def\\numberleft{\\tenrm\\folio\\hss}
- X\\def\\numbercenter{\\hss\\tenrm\\folio\\hss}
- X\\def\\numberright{\\tenrm\\folio\\hss}
- X\\def\\numberevenodd{\\ifodd\\pageno\\numberright\\else\\numberleft\\fi}
- X%% Macros for conditional end of page
- X\\def\\CondEOP#1{\\vskip0pt plus#1\\baselineskip\\penalty0
- X \\vskip0pt plus-#1\\baselineskip}
- X%%
- X
- X"
- X
- XEND="\\vfill\\eject\\end
- X%% That's all, folks.
- X"
- X
- X# How to make a one-line comment in TeX.
- XComment="%\n%% "
- Xcomment="\n"
- X
- X# Protect magic characters.
- X'%'="\\%%"
- X'$'="\\$"
- X'#'="\\#"
- X'&'="\\&"
- X'^'="\\^{}"
- X'_'="\\_"
- X'~'="\\~{}"
- X
- X# Curly braces and backslashes are intentionally left untranslated.
- X# If you want them to be converted, uncomment these three lines.
- X#
- X# '{'="$\\{$"
- X# '}'="$\\}$"
- X# '\\'="$\\backslash$"
- X#
- X# These characters are left untranslated because they do not exist
- X# in the TeX font tables. I.e., they won't be printed in boldface
- X# or italic or whatever font you selected; they always come from
- X# the math font.
- X
- X# Now the actual code expansions.
- X
- XPageNo="\\folio{}" # insert page number
- XRomanPage="\\pageno=-%1 " # set roman numerals
- XArabicPage="\\pageno=%1 " # set arabic numerals
- X
- XHSpace="~" # Unbreakable space
- X
- X# If you use tables, you may want to change the definition of Tab below.
- XTab="%\n\n\\indent " # Tabs mean to indent and start a new para.
- X
- XBeginTabs="%\n%% [Tab settings at "
- XSetTab="%1 "
- XSetTabCenter="%1(center) "
- XSetTabRight="%1(right) "
- XSetTabDecimal="%1(decimal) "
- XEndTabs="]\n"
- X
- XHPg="%\n\\vfill\\eject\n" # Hard page is just a \vfill\eject
- XCondEOP="\\CondEOP{%1}" # Conditional end-of-page
- X
- XHRt="%\n\n" # Hard return becomes a blank line
- XSRt="%\n" # Soft return is a newline
- X
- X-="-" # Hyphens are hyphens
- X--="-%%\n" # Hyphen at the end of a line gets a %
- X=="{-}" # Nonbreaking hyphen
- X\-="\\-" # Discretionary hyphen
- X\--="\\-%%\n" # Discretionary hyphen at the end of the line
- X
- X# Margins are left as comments, since TeX margins are rather hairy
- X# The only interesting that left/right margins does is end the paragraph.
- XMarg="%\n\n%% left margin %1, right margin %2\n"
- XTopMarg="%\n%% top margin %1\n"
- XPageLength="%\n%% page length %1\n"
- X
- X# Line spacing changes are treated by storing the proper value into
- X# \baselineskip.
- X
- XSS="\\baselineskip=\\normalbaselineskip\n"
- X1.5S="\\baselineskip=1.5\\normalbaselineskip\n"
- XDS="\\baselineskip=2\\normalbaselineskip\n"
- XTS="\\baselineskip=3\\normalbaselineskip\n"
- XLS="\\baselineskip=%1\\normalbaselineskip \\divide\\baselineskip by2\n"
- XLPI="%\n%% Change to %1 lines per inch\n"
- X
- XBold="{\\bf " # Boldface
- Xbold="}"
- XUnd="{\\it " # Underlining is in italics
- Xund="\\/}" # with italic correction stuck in always.
- XRed="{\\redline " # Redline
- Xred="}"
- XStrike="{\\strikeout " # Strikeout
- Xstrike="}"
- XRev="{\\reverse " # Reverse video
- Xrev="}"
- XOver="\\llap{" # Overprinting is faked with \llap
- Xover="}"
- XSup="\\raise.5ex\\hbox{" # fake superscript
- Xsup="}"
- XSub="\\lower.5ex\\hbox{" # fake subscript
- Xsub="}"
- X
- X# UpHalfLine, DownHalfLine, AdvanceToHalf -- undefined
- X
- XIndent="%\n\n{\\narrower " # Indented paragraphs use \narrower; this
- XDIndent="%\n\n{\\narrower " # is not a perfect solution, but it's a start.
- Xindent="\\par}"
- XMarginRelease="\\leavevmode\\kern-%1em "
- X
- XCenter="%\n\n\\centerline{"
- Xcenter="}"
- XCenterHere="\\centerhere{" # Not supported
- Xcenterhere="}"
- X
- XAlign="\\align{" # Not supported
- Xalign="}"
- XFlushRight="\\rightline{"
- Xflushright="}"
- X
- X# Math, math, MathCalc, MathCalcColumn, SubTtl, IsSubTtl, Ttl, IsTtl, GrandTtl
- X# Col, col -- undefined
- X
- XFn="\\note{" # This uses the \note macros in the TeXbook
- Xfn="}"
- XSetFn#="\\notenumber=%1 "
- XEn="\\endnote{" # You'll have to write your own \endnote macro
- Xen="}"
- XFNote#="" # Note numbers are automatically generated.
- XENote#="" # Note numbers should be automatically generated.
- X
- X# TableMarker -- undefined
- X
- XHyph="\\hyphenpenalty=50\n" # Allow hyphenation
- Xhyph="\\hyphenpenalty=10000\n" # Disable hyphenation
- XNoHyphWord="\\hbox{}" # Suppress hyphenation of next word
- XJust="\\rightskip=0pt\n" # Right justify
- Xjust="\\raggedright\n" # Ragged right
- XWid="\\clubpenalty=150 \\widowpenalty=150\n" # Widow protection
- Xwid="\\clubpenalty=0 \\widowpenalty=0\n" # Allow widows
- X
- X# HZone, DAlign -- undefined
- X
- X# Headers and footers
- XHeader="\\headline={"
- Xheader="}"
- XFooter="\\footline={"
- Xfooter="}"
- X
- X# These guys are left as comments, since actually doing them right
- X# requires all sorts of icky things I'd rather not think about.
- XSupp="%\n%% Suppress headers and footers on this page\n"
- XCtrPg="%\n%% Center this page vertically\n"
- XSetFont="%\n%% Change to %1 pitch, font %2\n"
- XSetBin="%\n%% Change to paper bin %1\n"
- X
- X# Page numbering
- XPN0="\\headline={\\hss}\\footline={\\hss}%%\n"
- XPN1="\\headline={\\numberleft}\\footline={\\hss}%%\n"
- XPN2="\\headline={\\numbercenter}\\footline={\\hss}%%\n"
- XPN3="\\headline={\\numberright}\\footline={\\hss}%%\n"
- XPN4="\\headline={\\numberevenodd}\\footline={\\hss}%%\n"
- XPN5="\\headline={\\hss}\\footline={\\numberleft}%%\n"
- XPN6="\\headline={\\hss}\\footline={\\numbercenter}%%\n"
- XPN7="\\headline={\\hss}\\footline={\\numberright}%%\n"
- XPN8="\\headline={\\hss}\\footline={\\numberevenodd}%%\n"
- END_OF_FILE
- if test 6395 -ne `wc -c <'tex.cfg'`; then
- echo shar: \"'tex.cfg'\" unpacked with wrong size!
- fi
- # end of 'tex.cfg'
- fi
- if test -f 'wp2x.1l' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'wp2x.1l'\"
- else
- echo shar: Extracting \"'wp2x.1l'\" \(16361 characters\)
- sed "s/^X//" >'wp2x.1l' <<'END_OF_FILE'
- X.TH WP2X 1
- X.SH NAME
- X wp2x \- A WordPerfect 4.2 to whatever converter
- X.SH SYNOPSIS
- X.B wp2x
- X[
- X.B \-s
- X] [
- X.BI \-n blip
- X] configfile wpfile
- X.SH DESCRIPTION
- X.de Tx
- X.if n TeX\\$1
- X.if t T\v'12u'E\v'-12u'X\\$1
- X..
- X.de Lt
- X.if n LaTeX\\$1
- X.if t L\v'-12u'A\v'12u'T\v'12u'E\v'-12u'X\\$1
- X..
- X.I Wp2x
- Xis intended to convert
- X.I simple
- Xfiles stored in WordPerfect 4.2 format into any other document processing
- Xlanguage that uses plain text files. Examples include
- X.Tx ,
- X.Lt ,
- Xtroff, GML, and SCRIPT.
- X.PP
- X.I Wp2x
- Xreads a configuration file and a WordPerfect 4.2 input file, and
- Xuses the information in them to produce an output file, which
- Xis sent to stdout.
- XIf the configuration file cannot be found, a suffix of
- X.I .cfg
- Xis appended.
- Xthe current directory is searched, as well as the directory
- X.I /usr/local/lib/wp2x ,
- Xand the directories specified by the environment variables
- X.I PATH ,
- X.I DPATH ,
- Xand
- X.I WP2XLIB .
- X.PP
- XThe following codes are processed by
- X.IR wp2x :
- X.nf
- X
- X Hard returns.
- X Sort returns.
- X Hyphens of all ages.
- X Hard page breaks.
- X Margin settings.
- X Line spacing.
- X Tab characters.
- X Boldface, underline, redline.
- X Indented paragraphs. (The "Indent" code.)
- X Footnotes and endnotes.
- X Footnote numbers inside footnotes.
- X Extended IBM codes.
- X Superscript, subscript, overstrike.
- X Hyphenation on/off.
- X Justification on/off.
- X Widow/Orphan control.
- X Hyphenation zone.
- X Decimal alignment character.
- X Page centering.
- X Page number position.
- X Headers and footers.
- X Single-page suppression of header/footer information.
- X Lots of other stuff.
- X
- XThe following codes are recognized, but not translated.
- X
- X Page number column
- X Underline mode
- X Column definitions
- X Footnote attributes
- X Automatic paragraph numbering
- X Marked text
- X Invisible text
- X
- X.fi
- XThese codes are not translated because documents that require these
- Xcodes typically would require significant hand-editing.
- XHence, there's no point in trying to emulate something you're going
- Xto delete anyway.
- X(Remember,
- X.I wp2x
- Xis not intended to be used as an automated conversion program.
- XRather, it is intended to be used as a single step in the document
- Xconversion process, which gets most of the the grunt work of conversion
- Xdone and out of the way, so that you can concentrate your efforts on
- Xconverting the trickier parts of the document. The object of the
- Xgame is to produce a readable conversion, rather than a perfect conversion.)
- X.PP
- XAs the program runs, a dot is printed to
- X.I stderr
- Xfor every 1024 characters converted. This can be suppressed with the
- X.B \-s
- Xswitch, and the interval between dots can be changed with the
- X.B -n
- Xswitch.
- X.SH OPTIONS
- X.TP
- X.B \-s
- XSuppresses all non-error output to
- X.IR stderr ,
- Xincluding the
- X.I typeout
- Xbanner, the progress dots, and warnings about undefined expansions.
- X.TP
- X.BI \-n blip
- XEvery
- X.I blip
- Xtokens, a dot is emitted to
- X.IR stderr ,
- Xunless the
- X.B \-s
- Xswitch is given.
- XThe value
- X.I blip
- Xmust appear imediately following the
- X.B \-n
- Xwithout an intervening space.
- XIf no
- X.B \-n
- Xswitch is supplied, then a value of 1024 is assumed.
- X.SH USAGE
- XThe configuration file controls how the file is converted from WordPerfect 4.2
- Xformat. Each line of the configuration file is of the form
- X.sp 1
- X.ce 1
- Xidentifier="list of codes"
- X.sp 1
- Xwhere the list of codes is a string which will be placed in the
- Xoutput stream whenever the corresponding WordPerfect code is
- Xencountered.
- XStandard C-style backslash-escape sequences are recognized, as well
- Xas \exFF for hex values.
- XYou do not have to backslash-protect a newline. Some identifiers
- Xsupply replacable parameters, which can be interpolated as follows:
- X.TP
- X%1
- Xinterpolate first parameter as a decimal integer.
- X.TP
- X%2
- Xinterpolate second parameter as a decimal integer.
- X.TP
- X%c
- Xinterpolate first parameter as an ASCII character.
- X.TP
- X%\en
- Xinterpolate a newline if the most-recently-output character was not
- Xalready a newline.
- X(The
- X.I \en
- Xcan be either the C-style escape sequence, or an actual newline character.)
- XUse this if the expansion must take place at the beginning of a line.
- X(For example,
- X.I troff
- Xcontrol characters must appear as the first character in the line in
- Xorder to take effect.)
- XThis sequence is meaningful only at the beginning of the string;
- Xif it appears elsewhere, it is flagged as erroneous.
- X.TP
- X%%
- Xinterpolate a percent-sign.
- X.PP
- XA percent sign followed by any other character is considered an error.
- XIt is also an error to interpolate a parameter that is not applicable
- Xto the identifier being defined. You may interpolate the parameters
- Xas many times as, and in whatever order, you wish. (With the
- Xexception of the
- X.I %\en
- Xcode.)
- X.PP
- XHere follows a list of the accepted identifiers.
- XIn the discussion, `%1' represents the first parameter, and `%2'
- Xthe second. Remember that the character version of %1 is available
- Xas `%c'.
- X.sp 1
- X.PD 0
- X.TP 15
- XBEGIN
- XExpanded at the beginning of the file.
- X.TP
- XEND
- XExpanded at the end of the file.
- X.TP
- XCOMMENT
- XExpanded when wp2x needs to insert a comment into the output.
- XThe comment is passed as %s.
- X.sp 1
- X.TP
- XPageNo
- XInsert current page number
- X.TP
- XRomanPage
- XSet page number to %1, and set roman-numeral mode
- X.TP
- XArabicPage
- XSet page number to %1, and set arabic-numeral mode
- X.sp 1
- X.TP
- XTab
- XWhat to do when you see a tab character.
- X.TP
- XBeginTabs
- XEmitted when tab settings are about to change.
- XThe
- X.B BeginTabs
- Xcode should delete all existing tabs
- Xand prepare for new tab settings to start.
- XAll tab values are given in columns measured
- Xfrom the physical left edge of the paper.
- X(Not from the left margin.)
- X.TP
- XSetTab
- XSet a normal (left-justified) tabstop at column %1.
- X.TP
- XSetTabCenter
- XSet a centered tabstop at column %1.
- X.TP
- XSetTabRight
- XSet a right-justified tabstop at column %1.
- X.TP
- XSetTabDecimal
- XSet a decimal tab at column %1.
- X.TP
- XEndTabs
- XFinish the setting of tabstops.
- X.sp 1
- X.PP
- XFor example, if the WordPerfect file contains a code that says
- X`Set new tabstops as follows: Regular tab at column 15,
- Xa centered tab at column 40, a right-justified tab at column 59,
- Xand a regular tab at column 60', then the following expansions are
- Xmade in succession:
- X.nf
- X
- X BeginTabs
- X SetTab(15)
- X SetTabCenter(40)
- X SetTabright(59)
- X SetTab(60)
- X EndTabs
- X
- X.fi
- X.TP
- XHSpace
- XHard (nonbreakable) space.
- X.TP
- XHPg
- XHard page break.
- X.TP
- XCondEOP
- XForce a new page if fewer than %1 half-lines remain on current page.
- X.sp 1
- X.TP
- XHRt
- XHard return.
- X.TP
- XSRt
- XSoft return.
- X.sp 1
- X.TP
- X\-
- XBreakable hyphen.
- X.TP
- X\-\-
- XBreakable hyphen, appearing at the end of a line.
- X.TP
- X=
- XNon-breakable hyphen.
- X.TP
- X\e\-
- XDiscretionary hyphen.
- X.TP
- X\e\-\-
- XDiscretionary hyphen, appearing at the end of a line.
- X.sp 1
- X.TP
- XMarg
- XSet left margin at %1 characters and right margin at %2 characters.
- X.TP
- XTopMargin
- XSet top margin to %1 lines.
- X.TP
- XPageLength
- XSet page length to %1 lines.
- X.sp 1
- X.TP
- XSS
- XSingle spacing.
- X.TP
- XDS
- XDouble spacing.
- X.TP
- X1.5S
- XOne-and-a-half spacing.
- X.TP
- XTS
- XTriple spacing.
- X.TP
- XLS
- XOther line spacing. %1 is twice the desired spacing.
- X(For example, a request for 2.5-spacing sets %1=5.)
- X.TP
- XLPI
- XSet %1 lines per inch (%1 is either 6 or 8)
- X.sp 1
- X.TP
- XBold
- XBegin boldface
- X.TP
- Xbold
- XEnd boldface
- X.TP
- XUnd
- XBegin underline
- X.TP
- Xund
- XEnd underline
- X.TP
- XRed
- XBegin redline
- X.TP
- Xred
- XEnd redline
- X.TP
- XStrike
- XBegin strikeout
- X.TP
- Xstrike
- XEnd strikeout
- X.TP
- XRev
- XBegin reverse video
- X.TP
- Xrev
- XEnd reverse video
- X.sp 1
- X.TP
- XOver
- XBegin overstrike
- X.TP
- Xover
- XEnd overstrike
- X.TP
- XSup
- XBegin superscript
- X.TP
- Xsup
- XEnd superscript
- X.TP
- XSub
- XBegin subscript
- X.TP
- Xsub
- XEnd subscript
- X.sp 1
- X.TP
- XUpHalfLine
- XAdvance printer up 1/2 line
- X.TP
- XDownHalfLine
- XAdvance printer down 1/2 line
- X.TP
- XAdvanceToHalfLine
- XAdvance to absolute vertical position.
- X%1 is what WordPerfect thinks the current vertical page position is,
- Xin half-lines. %2 is the desired position, also in half-lines.
- X.sp 1
- X.TP
- XIndent
- XExpanded when an "Indent" code appears.
- X.TP
- XDIndent
- XExpanded when a "left-and-right-indent" code appears.
- X.TP
- Xindent
- XExpanded at the end of an indented paragraph.
- X.TP
- XMarginRelease
- XMargin release. %1 is the number of characters to move left.
- X.sp 1
- X.TP
- XCenter
- XCenter current line
- X.TP
- Xcenter
- XEnd centering
- X.TP
- XCenterHere
- XCenter line around current column
- X.TP
- Xcenterhere
- XEnd centering
- X.sp 1
- X.TP
- XAlign
- XBegin alignment
- X.TP
- Xalign
- XEnd alignment
- X.TP
- XAlignChar
- XSet alignment character
- X.TP
- XFlushRight
- XBegin flush right
- X.TP
- Xflushright
- XEnd flush right
- X.sp 1
- X.TP
- XMath
- XBegin math mode
- X.TP
- Xmath
- XEnd math mode
- X.TP
- XMathCalc
- XBegin math calc mode
- X.TP
- XMathCalcColumn
- XMath calc column
- X.sp 1
- X.TP
- XSubTtl
- XDo subtotal
- X.TP
- XIsSubTtl
- XSubtotal entry
- X.TP
- XTtl
- XDo total
- X.TP
- XIsTtl
- XTotal entry
- X.TP
- XGrandTtl
- XDo grand total
- X.sp 1
- X.TP
- XCol
- XBegin column mode
- X.TP
- Xcol
- XEnd column mode
- X.sp 1
- X.TP
- XFn
- XExpanded at the beginning of a footnote.
- X.TP
- Xfn
- XExpanded at the end of a footnote.
- X.TP
- XEn
- XExpanded at the beginning of an endnote.
- X.TP
- Xen
- XExpanded at the end of an endnote.
- X.TP
- XSetFn#
- XSet the number for the next footnote to %1.
- X.TP
- XFNote#
- XFootnote number.
- X.TP
- XENote#
- XEndnote number.
- X.TP
- XTableMarker
- XInsert table of contents here
- X.sp 1
- X.TP
- XHyph
- XEnable hyphenation.
- X.TP
- Xhyph
- XDisable hyphenation.
- X.TP
- XJust
- XEnable justification.
- X.TP
- Xjust
- XDisable justification.
- X.TP
- XWid
- XEnable widow/orphan protection.
- X.TP
- Xwid
- XDisable widow/orphan protection.
- X.TP
- XHZone
- XThe hyphenation zone. %1 and %2 are the two magical values
- Xthat WordPerfect uses to control hyphenation.
- X.TP
- XDAlign
- XSet the decimal alignment character to that whose ASCII value is %1.
- X(`%c' is useful here.)
- X.sp 1
- X.TP
- XHeader
- XBegin header text
- X.TP
- Xheader
- XEnd header text
- X.TP
- XFooter
- XBegin footer text
- X.TP
- Xfooter
- XEnd footer text
- X.sp 1
- X.TP
- XSupp
- XSuppress page number/header/footer information for one page.
- X%1 argument is a bit field which describes what sort of
- Xsuppression is desired. Here's what the bits mean:
- X.nf
- X 1 = all
- X 2 = page number
- X 4 = page numbers moved to bottom
- X 8 = all headers
- X 16 = header a
- X 32 = header b
- X 64 = footer a
- X 128 = footer b
- X.fi
- X.TP
- XCtrPg
- XCenter page vertically
- X.sp 1
- X.TP
- XSetFont
- XChange pitch or font. %1 is the desired pitch. (Negative
- Xmeans proportionally-spaced.) %2 is the font number.
- X.TP
- XSetBin
- XSelect paper bin to %1 = 0, 1, ...
- X.sp 1
- X.TP
- XPN0
- XNo page numbering.
- X.TP
- XPN1
- XPage number in top left.
- X.TP
- XPN2
- XPage number in top center.
- X.TP
- XPN3
- XPage number in top right.
- X.TP
- XPN4
- XPage number on top outside corners (even/odd).
- X.TP
- XPN5
- XPage number in lower left.
- X.TP
- XPN6
- XPage number in bottom center.
- X.TP
- XPN7
- XPage number in lower right.
- X.TP
- XPN8
- XPage number on bottom outside corners (even/odd).
- X.PD
- X.PP
- XIf no expansion is supplied for an identifier, then nothing is emitted to
- X.IR stdout ,
- Xbut a warning message is sent to
- X.IR stderr .
- XThis warning message will appear at most once per identifier, and it
- Xcan be suppressed completely by the
- X.B \-s
- Xoption.
- X.PP
- XThe special identifier
- X.I typeout
- Xcauses its replacement text to be
- Xdisplayed on the screen every time the configuration file is read.
- XThis is useful for identification messages, or reminders to the user.
- X.PP
- XA special identifier is any character enclosed in single quotation
- Xmarks, which represent themselves. For example,
- X.nf
- X
- X '\(*a'="{\e\ealpha}"
- X
- X.fi
- Xcauses the string "{\ealpha}" to be emitted when an \(*a is encountered.
- XThis could also have been written as
- X.nf
- X
- X '\exE0'="{\e\ealpha}"
- X
- X.fi
- Xif the character \(*a has ASCII value 0xE0.
- X(Which is true for the IBM PC encoding.)
- X.PP
- XIf no definition exists for a particular special character,
- Xit is transmitted undisturbed. If a special character is encountered
- Xfrom the upper half of the ASCII character set, and if it has no
- Xdefinition, then a warning message is also emitted.
- X(Which can be suppressed with the
- X.B \-s
- Xoption.)
- X.PP
- XLines beginning with the # character are comments.
- X.SH FILES
- XThe sample configuration files in
- X.I /usr/local/lib/wp2x
- Xgive you some sort of idea what a `production quality'
- Xconfiguration file might look like.
- XThey are not intended to be used as-is, but rather are meant to be
- Xmodified to suit your particular needs.
- X.SH "SEE ALSO"
- X.IR tex (1),
- X.IR latex (1),
- X.IR nroff (1),
- X.IR troff (1).
- X.SH DIAGNOSTICS
- X.TP
- XError: Cannot open X (reason)
- XThe file X could not be opened, for the indicated reason.
- X.TP
- XError: Expecting a hex digit
- XInside a string, you typed the characters `\ex', but the next character
- Xwas not a valid hex digit.
- X.TP
- XError: string pool overflow
- XThe configuration file contained too many strings. Increase the value
- Xof POOL_SIZE and recompile.
- X.TP
- XError: Unknown identifier X
- XThe word X was encountered in the configuration file when
- X.I wp2x
- Xexpected a token identifier like `HRt'.
- XMost likely, you either misspelled it, or you got your quotation marks
- Xout of sync.
- X.TP
- XError: Identifier not followed by = sign
- XAfter an identifier must come an equals-sign.
- X.TP
- XError: Quotation mark expected
- XAfter the equals-sign must come a quotation mark.
- X.TP
- XError: X: `%\en' not at start of expansion
- XThe expansion for the identifier X contained the indicated sequence
- Xof characters somewhere other than the beginning of the string.
- XThe `%\en' interpolation code is meaningful only at the beginning
- Xof a string.
- X.TP
- XError: X: invalid escape `%x'
- XThe expansion for the identifier X contained an invalid escape.
- XEither you used `%1', `%2' or `%c' when the identifier X does not
- Xsupply that parameter, or you meant for a genuine percent sign
- Xto be output, in which case you should put `%%' in the expansion.
- X.TP
- XError: Invalid character identifier
- XCharacter identifiers can only be one character long (after backslash
- Xinterpretation).
- X.TP
- XWarning: Expected XX but received YY.
- XThe program expected the next byte from the WP file to be XX, but
- Xthe byte YY was encountered instead. This means either that your WP
- Xfile is damaged, or that the program is seriously confused. (Or both.)
- XThe program
- Xwill pretend that the byte in the file was indeed XX, which may
- Xlead to synchronization errors later on.
- X.TP
- XWarning: No expansion for X
- XThe WP file contained the token X, but the configuration file did not
- Xcontain any expansion text for it. A null expansion was assumed.
- X.TP
- XWarning: No expansion for XX (c)
- XThe WP file contained the character c (hex code XX),
- Xbut the configuration file
- Xdid not contain any expansion text for it.
- XThe character was emitted unaltered.
- XBeware that this may give your text formatter indigestion if it does
- Xnot handle eight-bit characters.
- X.TP
- XWarning: X code not supported
- XThe file being converted uses a code which
- X.I wp2x
- Xdoes not know how to convert.
- XA comment is placed in the output file in its place.
- XIf you ever encounter a `WPCorp reserved' or a `WPCorp undefined' code,
- Xthe author would appreciate hearing from you.
- X.TP
- XInternal error: Invalid escape, %x
- XWhile processing text,
- X.I wp2x
- Xnoticed that you used an invalid escape.
- XNothing is emitted as the escape text.
- X(The internal-ness is that this error is supposed to be caught at
- Xthe time the configuration file is read.)
- X.SH BUGS
- XNaive configuration files will fail if your WP file
- Xdoesn't nest its tags properly. A typical case is
- X.nf
- X
- X [Center][B]Hello[center]
- X [Center]There[b][center]
- X.fi
- Xto produce a centered boldface `Hello'. If you use the naive encoding
- Xof
- X.nf
- X
- X Center="\e\ecenterline{"
- X center="}\en"
- X Bold="{\e\ebf "
- X bold="}"
- X
- X.fi
- Xthen this will expand to
- X.nf
- X
- X \ecenterline{{\ebf Hello}
- X \ecenterline{There}}
- X
- X.fi
- XWordPerfect has no clean concept of grouping; it lets you change fonts
- Xat any time and let those changes propagate outside the current
- Xenvironment.
- X(With the exception of headers, footers, footnotes, and endnotes.)
- X.PP
- XNow sure, you could write complicated configuration strings to try
- Xto handle this `properly', but it'd probably not be worth the trouble.
- XAfter all, the purpose is not to perform a perfect conversion, but
- Xrather to produce a
- X.I readable
- Xconversion, which can then be massaged by hand to produce a perfect
- Xmanuscript.
- X.PP
- XAnother potential problem is combined attributes, like boldface underline.
- XUnder a naive configuration,
- X.nf
- X
- X [B]Boldface [U]Underlined boldface[b] Underlined[u] normal.
- X
- X.fi
- Xcomes out as
- X.nf
- X
- X {\ebf Boldface {\eit Underlined boldface} Underlined\e/} normal.
- X
- X.fi
- Xwhich is wrong for two reasons. One is the nesting problem discussed
- Xabove. The other is that
- X.Tx
- Xfont attributes do not combine.
- X.PP
- XSimilar problems exist for other document preparation systems.
- XSo be careful.
- X.SH AUTHOR
- XRaymond Chen (raymond@math.berkeley.edu)
- END_OF_FILE
- if test 16361 -ne `wc -c <'wp2x.1l'`; then
- echo shar: \"'wp2x.1l'\" unpacked with wrong size!
- fi
- # end of 'wp2x.1l'
- fi
- echo shar: End of archive 2 \(of 3\).
- cp /dev/null ark2isdone
- MISSING=""
- for I in 1 2 3 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 3 archives.
- rm -f ark[1-9]isdone
- else
- echo You still need to unpack the following archives:
- echo " " ${MISSING}
- fi
- ## End of shell archive.
- exit 0
-
- exit 0 # Just in case...
-